{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import joblib\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['f_score_33465']"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xgb_model = joblib.load('model_33465')\n",
    "feature_names = joblib.load('feature_names')\n",
    "\n",
    "f_score_33465 = pd.Series(xgb_model.get_fscore()).sort_values(ascending=False)\n",
    "\n",
    "joblib.dump(f_score_33465,'f_score_33465')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['f_score_30465']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xgb_model = joblib.load('model_30465')\n",
    "feature_names = joblib.load('feature_names')\n",
    "\n",
    "f_score_30465 = pd.Series(xgb_model.get_fscore()).sort_values(ascending=False)\n",
    "\n",
    "joblib.dump(f_score_30465,'f_score_30465')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['f_score_3000']"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xgb_model = joblib.load('model_3000')\n",
    "feature_names = joblib.load('feature_names')\n",
    "\n",
    "f_score_3000 = pd.Series(xgb_model.get_fscore()).sort_values(ascending=False)\n",
    "\n",
    "joblib.dump(f_score_30465,'f_score_3000')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "null_sign_f16      80\n",
       "null_sign_f412     67\n",
       "null_sign_f5027    58\n",
       "null_sign_f477     49\n",
       "null_sign_f5930    47\n",
       "null_sign_f385     46\n",
       "null_sign_f3906    45\n",
       "null_sign_f415     43\n",
       "null_sign_f891     42\n",
       "null_sign_f231     38\n",
       "dtype: int64"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f_score_33465[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "null_sign_f16      74\n",
       "null_sign_f412     55\n",
       "null_sign_f5027    52\n",
       "null_sign_f5930    46\n",
       "null_sign_f477     40\n",
       "null_sign_f3906    39\n",
       "null_sign_f409     38\n",
       "null_sign_f2815    36\n",
       "null_sign_f190     34\n",
       "null_sign_f231     32\n",
       "dtype: int64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f_score_30465[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "null_sign_f412     25\n",
       "null_sign_f2137    20\n",
       "null_sign_f231     19\n",
       "null_sign_f477     17\n",
       "null_sign_f1025    15\n",
       "null_sign_f176     15\n",
       "null_sign_f8       15\n",
       "null_sign_f5027    15\n",
       "null_sign_f5572    13\n",
       "null_sign_f5922    13\n",
       "dtype: int64"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f_score_3000[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "f_score = f_score_33465 + f_score_3000 + f_score_30465"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "f_score = f_score.dropna().sort_values(ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['f_score']"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "joblib.dump(f_score,'f_score')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
